package com.andy.stripes.actions;

import java.util.List;

import net.sourceforge.stripes.action.DefaultHandler;
import net.sourceforge.stripes.action.ForwardResolution;
import net.sourceforge.stripes.action.Resolution;
import net.sourceforge.stripes.integration.spring.SpringBean;

import com.andy.stripes.domain.Article;
import com.andy.stripes.service.ArticleService;

public class BlogActionBean  extends AbstractActionBean{
	
	private static  final String VIEW_LIST="/articles.jsp";
	private static  final String VIEW_blog="/myblog.jsp";
	
	
	@SpringBean
	private ArticleService articleService;
	
	private  List<Article>  articles ;
	
	
	@DefaultHandler
	public Resolution  searchArticleList()
	{ 
		articles =articleService.searchArticleList();
		return new ForwardResolution(VIEW_LIST);
		
	}


	public List<Article> getArticles() {
		return articles;
	}

	
	
	
	public Resolution  toUserBlog()
	{
		
		return new ForwardResolution(VIEW_blog);	
	}
	
	



}
